package com.lqq.controller;

import com.lqq.dao.DeptMapper;
import com.lqq.entity.Dept;
import com.lqq.entity.Msg;
import com.lqq.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by lqq on 2017/6/29.
 */
@Controller
public class DeptController {

    @Autowired
    private DeptService deptService;

    @RequestMapping("/dept/getAll")
    @ResponseBody
    public Msg getAllDepts(){

        List<Dept> list = deptService.getAllDepts();

        return Msg.success().add("dept_list",list);
    }

}
